#include <asm.h>
#include <regdef.h>
#include <new_inst_test.h>
#define instr bltzall


LEAF(my29_bltzall_test)
    .set noreorder
    addiu s0,s0,1
    li    s2,0
    li t0,0x800d6000
    sw ra,0(t0)
###test inst
    TEST_BRANCH_LINK_LIKE(instr,0xffff2222,0x1,concat(instr,dont_jump_1),concat(instr,jump_1)) ;
    TEST_BRANCH_LINK_LIKE(instr,0xffff3eaa,0x5b8a,concat(instr,dont_jump_2),concat(instr,jump_2)) ;
    TEST_BRANCH_LINK_LIKE(instr,0xfffe6fb8,0xed,concat(instr,dont_jump_3),concat(instr,jump_3)) ;
    TEST_BRANCH_LINK_LIKE(instr,0xffb97082,0x5c0,concat(instr,dont_jump_4),concat(instr,jump_4)) ;
    TEST_BRANCH_LINK_LIKE(instr,0xfff986ef,0x108f,concat(instr,dont_jump_5),concat(instr,jump_5)) ;
    TEST_BRANCH_LINK_LIKE(instr,0xffff13ee,0x6,concat(instr,dont_jump_6),concat(instr,jump_6)) ;
    TEST_BRANCH_LINK_LIKE(instr,0xfdefab7d,0x0,concat(instr,dont_jump_7),concat(instr,jump_7)) ;
    TEST_BRANCH_LINK_LIKE(instr,0xfff3c157,0xd61,concat(instr,dont_jump_8),concat(instr,jump_8)) ;
    TEST_BRANCH_LINK_LIKE(instr,0xfff829f9,0x20aa63a,concat(instr,dont_jump_9),concat(instr,jump_9)) ;
    TEST_BRANCH_LINK_LIKE(instr,0xffb970f1,0x15a,concat(instr,dont_jump_10),concat(instr,jump_10)) ;
    TEST_BRANCH_LINK_LIKE(instr,0xffca64c9,0x237f,concat(instr,dont_jump_11),concat(instr,jump_11)) ;
    TEST_BRANCH_LINK_LIKE(instr,0xfdef8279,0xbdb8,concat(instr,dont_jump_12),concat(instr,jump_12)) ;
###detect exception
    bne s2,zero,inst_error
    nop
###score ++
    addiu s3, s3, 1
###output (s0<<24)|s3
test:
    beq s0,s3,inst_error
    nop
    addiu s3,s3,1
    j test
    nop
inst_error:
    sll t1, s0, 24
    or t0, t1, s3
    sw t0, 0(s1)
    li t7,0x800d6000
    lw ra,0(t7)
    jr ra
    nop
END(my29_bltzall_test)
